package client.stats;

public enum MonsterStatus implements GlobalBuffStat {

    NEUTRALISE                  (0x2, 4),
    IMPRINT                     (0x4, 4),
    MONSTER_BOMB                (0x8, 4),
    MAGIC_CRASH                 (0x10, 4),
    WATK                        (0x100000000L, 4),
    WDEF                        (0x200000000L, 4),
    MATK                        (0x400000000L, 4),
    MDEF                        (0x800000000L, 4),
    ACC                         (0x1000000000L, 4),
    AVOID                       (0x2000000000L, 4),
    SPEED                       (0x4000000000L, 4),
    STUN                        (0x8000000000L, 4),
    FREEZE                      (0x10000000000L, 4),
    POISON                      (0x20000000000L, 4),
    SEAL                        (0x40000000000L, 4),
    SHOWDOWN                    (0x80000000000L, 4),
    WEAPON_ATTACK_UP            (0x100000000000L, 4),
    WEAPON_DEFENSE_UP           (0x200000000000L, 4),
    MAGIC_ATTACK_UP             (0x400000000000L, 4),
    MAGIC_DEFENSE_UP            (0x800000000000L, 4),
    DOOM                        (0x1000000000000L, 4),
    SHADOW_WEB                  (0x2000000000000L, 4),
    WEAPON_IMMUNITY             (0x4000000000000L, 4),
    MAGIC_IMMUNITY              (0x8000000000000L, 4),
    NINJA_AMBUSH                (0x40000000000000L, 4),
    VENOMOUS_WEAPON             (0x100000000000000L, 4), //BURN
    DARKNESS                    (0x200000000000000L, 4),
    POISON2                     (0x800000000000000L, 4),
    HYPNOTIZE                   (0x1000000000000000L, 4),
    WEAPON_DAMAGE_REFLECT       (0x2000000000000000L, 4),
    MAGIC_DAMAGE_REFLECT        (0x4000000000000000L, 4),
    SUMMON                      (0x8000000000000000L, 4); //all summon bag mobs have.
    ;

    private final long i;
    private final byte index;

    private MonsterStatus(long i) {
        this.i = i;
        index = 4;
    }

    private MonsterStatus(long i, int index) {
        this.i = i;
        this.index = (byte) index;
    }

    private MonsterStatus(int i, boolean first) {
        this.i = i;
        this.index = first ? (byte) 3 : (byte) 4;
    }

    public boolean isFirst() {
        return index == 3;
    }

    @Override
    public int getIndex() {
        return index;
    }

    public boolean isEmpty() {
        return this == SUMMON;
    }

    @Override
    public long getValue() {
        return i;
    }
}
